#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QCheckBox>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QFrame>
#include <QGraphicsDropShadowEffect>
#include <QPixmap>

class LoginWidget : public QWidget
{
    Q_OBJECT

public:
    explicit LoginWidget(QWidget *parent = nullptr);
    ~LoginWidget();

    // 数据访问接口
    QString getUsername() const;
    void setUsername(const QString &username);
    
    QString getPassword() const;
    void setPassword(const QString &password);
    
    bool isRememberPassword() const;
    void setRememberPassword(bool remember);
    
    void clearForm();

signals:
    void loginRequested(const QString &username, const QString &password);
    void forgotPasswordClicked();
    void exitRequested();

private slots:
    void onLoginClicked();
    void onForgotPasswordClicked();

private:
    void setupUI();
    void setupConnections();
    
    // UI组件
    QFrame *m_loginFrame;
    QLabel *m_titleLabel;
    QLabel *m_usernameIcon;
    QLineEdit *m_usernameEdit;
    QLabel *m_passwordIcon;
    QLineEdit *m_passwordEdit;
    QCheckBox *m_rememberCheckBox;
    QPushButton *m_loginButton;
    
    // 布局
    QGridLayout *m_mainLayout;
    QVBoxLayout *m_frameLayout;
    QHBoxLayout *m_usernameLayout;
    QHBoxLayout *m_passwordLayout;
    QHBoxLayout *m_optionsLayout;
};

#endif // LOGINWIDGET_H
